package homework.mid_autumn_festival.string_exercise;

public class ValueOfDemo {
    public static void main(String[] args) {
        int a = 123;
        String s1 = String.valueOf(a);
        System.out.println(s1);

        double b = 0.134;
        String s2 = String.valueOf(b);
        System.out.println(s2);

        String s3 = b+"";//任何类型与字符串相连都会变成字符串,效率低,因为每次都会在堆中创建新的对象,占用内存
        System.out.println(s3);
    }
}
